perm filename INTOPS.NEW[AL,HE]1 blob
sn#341241 filedate 1978-03-10 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 .SBTTL Table of interpreter instructions
C00013 ENDMK
C⊗;
.SBTTL Table of interpreter instructions
COMMENT ⊗
This table is parallel to the file INTDEF.SAI[AL,HE]. It is required
at several places in the interpreter; each of these can define the
macro MAKEOP however desired. The convention here for types of
arguments that each pseudo-op takes is this:
a absolute address
la list of absolute addresses
o offset or level-offset pair
lo list of offsets or level-offset pairs
n small constant
r50 word of radix 50
⊗
PCVERSION == 7 ;Fix this every time you add some new pcodes
II == 2 ;Start of interpreter jump table (0 is illegal instruction)
;Motion control
MAKEOP XMOVE,MOVE,1,<a> ;Prepare, execute move whose traj table is at a.
MAKEOP XCENTER,CENTER,1,<a>, ;Center using traj table at a.
MAKEOP XSTOP,STOP,1,<n> ;Cause all mechanisms whose bits are on in n to stop.
MAKEOP XTFRCST,TFRCST,1,<n> ;Initializes force system, force frame on stack
; control bits in <n>
MAKEOP XVMKFRC,VMKFRC,0 ;Gets vector off stack, makes a force frame along vector
; and puts it on the stack
MAKEOP XCOMPLY,COMPLY,1,<n> ;Sets up compliant motion in next move
;Gets force magnitude off stack, control bits in <n>
MAKEOP XCMPOFF,CMPOFF,1,<n> ;Turns off compliant motion in current move (not used)
MAKEOP XNOTICE,NOTICE,0 ;Make sure everyone knows where the arm is.
;Variables
MAKEOP XMVAR,MVAR,7,<lo> ;Make graph node for given offsets (list arg)
MAKEOP XKVAR,KVAR,7,<lo> ;Kill graph node at given offsets (list arg)
MAKEOP XGLBLNK,GLBLNK,9,<lo,r50,r50>
;Link global given by r50,r50 into level-offset lo.
MAKEOP XMAKEVT,MAKEVT,7,<lo> ;Make event variables with offsets as in list.
MAKEOP XDESEVT,DESEVT,7,<lo> ;Kill event variables with offsets as in list.
MAKEOP XMEXP,MEXP,9,<lo,a,o> ;Make an expression whose needed list is lo
; at address a, and call it offset o.
MAKEOP XMCLC,MCLC,2,<o,o>;Make the expression at level-offset o1 a calculator
; for the variable at o2.
MAKEOP XDCLC,DCLC,2,<o,o>;Unmake the expression at level-offset o1 a calculator
; for the variable at o2.
MAKEOP XMCHG,MCHG,2,<o,a>;Make a changer for variable at level-offset o at address a.
MAKEOP XGTOLD,GTOLD,0 ;Get the old value for current changer.
MAKEOP XGTNEW,GTNEW,0 ;Get the new value for current changer.
;Stack operations
MAKEOP XGTVAL,GTVAL,1,<o>;Push value of arg (level-offset pair).
MAKEOP XIGTVAL,IGTVAL,1,<a> ;Push arg (immediate).
MAKEOP XCHNGE,CHNGE,1,<o>;Pop value into arg (level-offset pair).
MAKEOP XICHNGE,ICHNGE,1,<a>;Pop value into arg (immediate).
MAKEOP XPUSH, PUSH,1,<a> ;Push arg directly (as a ptr) onto stack. For cnstnts.
MAKEOP XPOP, POP, 0 ;Pop stack.
MAKEOP XCOPY, COPY ,1,<n>;Copy n'th down to top of stack.
MAKEOP XREPLAC,REPLAC,1,<n> ;Replace n'th down with top (which pop)
MAKEOP XFLUSH,FLUSH,0 ;Flush the entire stack.
;Flow of control
MAKEOP XJUMP, JUMP, 1,<a> ;Jump to address
MAKEOP XJUMPC,JUMPC,1,<a> ;Jump to address if "true"
MAKEOP XTERMINATE,TERMINATE,0 ;Terminate this interpreter
MAKEOP XENDCLC,ENDCLC,0 ;Return from calculator cell
MAKEOP XPROC, PROC,7,<a,lo> ;Call a procedure at a, with arg list lo
MAKEOP XRETURN,RETURN,0;Return from procedure
MAKEOP XSPROUT,SPROUT,7;la ;Sprout interpreters at each arg, wait (list arg)
MAKEOP XFORCHK,FORCHK,1,<a> ;Do a FOR-loop check, and fail to location d.
MAKEOP XSIGNAL,SIGNAL,1,<o> ;Signal event at level-offset o.
MAKEOP XWAITE,WAITE,1,<o> ;Wait on event at level-offset o.
MAKEOP XPAUSE,PAUSE,0 ;Pause in seconds (on stack)
MAKEOP XABORT,ABORT,0 ;Abort current motions
MAKEOP XDDT,GODDT,0 ;go to DDT.
;Boolean
MAKEOP XSLE,SLE,0 ;S≤S compare top two elts, pop, pop, push answer
MAKEOP XSLT,SLT,0 ;S<S true := 1.0
MAKEOP XSGE,SGE,0 ;S≥S false:= 0
MAKEOP XSGT,SGT,0 ;S>S
MAKEOP XSEQ,SEQ,0 ;S=S
MAKEOP XSNE,SNE,0 ;S≠S
MAKEOP XAND,AND,0 ;S∧S (logical and)
MAKEOP XLOR,LOR,0 ;S∨S (logical or)
MAKEOP XNOT,NOT,0 ;¬S (logical not) note: this only takes one arg
;Arithmetic
MAKEOP XWHERE,WHERE,1,<n> ;Push the current location of mechanism n
MAKEOP XSADD, SADD, 0 ;S+S: Add top two elts, pop, pop, push answer
MAKEOP XSSUB, SSUB, 0 ;S-S: Sub top two elts, pop, pop, push answer
MAKEOP XSNEG, SNEG, 0 ;-S: Negate top elt, pop, push answer
MAKEOP XSMUL, SMUL, 0 ;S*S: Mul top two elts, pop, pop, push answer
MAKEOP XSDIV, SDIV, 0 ;S/S: Div top two elts, pop, pop, push answer
MAKEOP XVMAGN, VMAGN,0 ;S ← norm of vector
MAKEOP XVDOT, VDOT, 0 ;S ← vector dot vector
;PVDOT ;S ← vector dot vector all 4 cells
MAKEOP XCROSV,CROSV,0 ;Vector ← vector cross vector
MAKEOP XSSBRTN,SSBRTN,1,<n> ;S ← SBRTN[n](top scalar elt)
MAKEOP XTMAGN,TMAGN,0 ;S ← extracts angle of rotation from trans
MAKEOP XTAXIS,TAXIS,0 ;V ← extracts axis of rotation from trans
MAKEOP XVMAKE,VMAKE,0 ;V ← vector(scalar,scalar,scalar)
MAKEOP XSVMUL,SVMUL,0 ;V ← scalar * vector
MAKEOP XVADD, VADD,0 ;V ← vector + vector
MAKEOP XVSUB, VSUB,0 ;V ← vector - vector
MAKEOP XUNITV,UNITV,0 ;Vector ← vector / its norm
;CROSV remove ;Vector ← vector cross vector
MAKEOP XTVMUL,TVMUL,0 ;Vector ← trans * vector
MAKEOP XTPOS,TPOS,0 ;Vector ← translation_part_of_trans
MAKEOP XTORIEN,TORIEN,0;T ← rotation_part_of_trans
MAKEOP XVSAXWR,VSAXWR,0;T ← rotation(vector,angle)
MAKEOP XTMAKE,TMAKE,0 ;T ← trans(rot,vector)
MAKEOP XTVADD,TVADD,0 ;T ← t + v
MAKEOP XTVSUB,TVSUB,0 ;T ← t - v
;FTOF ;T ← INV(t1) * t2 done by TTMUL(TINVRT(t1),t2) in pcode
MAKEOP XTTMUL,TTMUL,0 ;T ← trans * trans
MAKEOP XTINVRT,TINVRT,0;T ← trans * trans
;Condition monitors
MAKEOP XCMMAK,CMMAK,3,<o,t,a> ;Make a c-m at offset o of type t starting at a
MAKEOP XCMENBL,CMENBL,1,<o> ;Enable c-m at level-offset o
MAKEOP XCMDSBL,CMDSBL,1,<o> ;Disable c-m at level-offset o
MAKEOP XCMDEST,CMDEST,7,<lo> ;Destroy c-m at offset lo (list arg)
MAKEOP XCMTRIG,CMTRIG,0 ;Trigger the c-m body (use only in checker)
MAKEOP XCMSKED,CMSKED,1,<n> ;Sleep for n mills (use only in checker)
MAKEOP XCMUNCR,CMUNCR,0 ;Start uncritical section
MAKEOP XCMDONE,CMDONE,0 ;Ends force/hardware/duration c-m's, if c-m was
; re-enabled then restarts it, else dismisses it
MAKEOP XCMFORCE,CMFORCE,0 ;Initialize force sensing - vector & level on stack
MAKEOP XCMSENSE,CMSENSE,0 ;Initialize hardware sensing
MAKEOP XCMDUR,CMDUR,0 ;Wait for set time, then start up c-m
;Initialization
MAKEOP XPROG,PROG,0 ;Initialize mechanism variables
MAKEOP XENDP,ENDP,0 ;Clean up mechanism variables
;Debugging aids
MAKEOP XPRINT,PRINT,0 ;Type an ASCIZ string on the VT05.
MAKEOP XVALPRN,VALPRN,0;Type a value, whatever type it is, and pop it.
MAKEOP XVARPRN,VARPRN,1,<o> ;Type a variable (level-offset), whatever type.
MAKEOP XBRACE,BRACE,0 ;HN (MODIFIED BY) Bracepoint in the program (break or trace)
MAKEOP XNOOP,NOOP,0 ;Null operation
MAKEOP XTOPAL,TOPAL,0 ;Escape to PAL